package com.example.tools.httputils.ok;

import android.util.Log;

import com.google.gson.Gson;

/**
 * Created by Administrator on 2016/10/18.
 */

public class GsonUtils {

    private static Gson gson;

    private void GsonUtils(){};

    public void init(){
        gson = new Gson();
    }

    public static <T> T toJson(String content, Class<T> entity){
               gson = new Gson();

        try{
            T entity2 = gson.fromJson(content,entity);
            return entity2;
        } catch (Exception e){
            Log.e("=====","===解析异常捕获");
            return null;
        }



    }

}
